package com.server;

import com.client.services.GreetingService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService {
	public String greetServer(String input) throws IllegalArgumentException {
		if (input.length()<4) {
			throw new IllegalArgumentException("Name must be at least 4 characters long");
		}

		String userAgent = getThreadLocalRequest().getHeader("User-Agent");
		return "Hallo " + input + "!<br><br>UserAgentString:<br>" + userAgent;
	}
}